<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2020/1/6
 * Time: 18:16
 */
namespace app\demo\controller;

use app\BaseController;
use app\common\business\Demo;
class M extends BaseController{

    public function index(){
        $categoryId = $this->request->param("category_id",0,"intval");
        if (empty($categoryId)){
            return show(config("status.error"),"参数错误");
        }

        $model = new Demo();
        $result = $model->getDemoDataByCategoryId($categoryId);

        return show(config("status.success"),"成功",$result);
    }

}